package com.swpu.service_remind.controller;

import com.swpu.commonutils.R;
import com.swpu.service_remind.service.OssService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
@RestController
@RequestMapping("/service_oss/fileUpload")
public class OSSController {
    @Autowired
    private OssService ossService;

    @PostMapping
    public R upLoadFile(MultipartFile file){
        String fileUrl= ossService.upLoadFileAvatar(file);
        System.out.println(fileUrl);
        return R.ok().data("fileUrl",fileUrl);
    }
}
